﻿using System;

namespace ScriptEngine.Script.Util
{
	[AttributeUsage(AttributeTargets.Property)]
	public class ScriptObjectPropertyAttribute : Attribute
	{
		/// <summary>
		/// 属性在脚本对象中的名称
		/// </summary>
		public string ObjectNameInScriptObject { get; }

		/// <summary>
		/// 属性是否必选
		/// </summary>
		public bool Require { get; }

		/// <summary>
		/// 非必选时属性的默认值
		/// </summary>
		public object DefaultValue { get; }

		public ScriptObjectPropertyAttribute(string objectNameInScriptObject, bool require = true, object defaultValue = null)
		{
			ObjectNameInScriptObject = objectNameInScriptObject;
			Require = require;
			DefaultValue = defaultValue;
		}
	}
}
